with v8.Class_String;
package v8.Class_Script_Data is
   type Script_Data is limited interface;
   type Pointer is access all Script_Data'Class;
 -- Pre-compilation data that can be associated with a script.  This
 -- data can be calculated for a script in advance of actually
 -- compiling it, and can be stored between compilations.  When script
 -- data is given to the compile method compilation will be faster.



   procedure Destroy (This : in out Script_Data) is abstract;
   -- virtual destuctor

   procedure Free (This : access Script_Data) is abstract;
   -- virtual operator delete

   function Length (This : Script_Data) return int is abstract;
   -- Returns the length of Data().

   function Data (This : Script_Data) return System.Address is abstract;
   -- Returns a serialized representation of this ScriptData that can later be
   -- passed to New(). NOTE: Serialized data is platform-dependent.

   function Has_Error (This : Script_Data) return Bool is abstract;
   -- Returns true if the source code could not be parsed.



   function Pre_Compile (Source : String) return Pointer;
   -- Pre-compiles the specified script (context-independent).
   --
   -- \param input Pointer to UTF-8 script source code.
   -- \param length Length of UTF-8 script source code.

   function Pre_Compile (Source : v8.Class_String.Pointer) return Pointer;
   -- Pre-compiles the specified script (context-independent).
   --
   -- NOTE: Pre-compilation using this method cannot happen on another thread
   -- without using Lockers.
   --
   -- \param source Script source code.

   function Create (data : Address; length : int) return Pointer;
   -- Load previous pre-compilation data.
   --
   -- \param data Pointer to data returned by a call to Data() of a previous
   --   ScriptData. Ownership is not transferred.
   -- \param length Length of data.

private

   pragma Import (CPP, Create, "_ZN2v810ScriptData3NewEPKci");


end v8.Class_Script_Data;



